package com.itheima.domain.vo;

import cn.hutool.core.bean.BeanUtil;
import com.itheima.domain.db.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

// 动态发布表
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AdviceVo implements Serializable {
    private String id; //主键id
    private Long userId; // 用户id
    private String textContent; //建议内容
    //private String created; //发布时间

    // 设置用户信息
    public void setUserInfo(UserInfo userInfo) {
        if (userInfo != null) {
            BeanUtil.copyProperties(userInfo, this);
        }
    }

}